package it.uniroma2.art.owlart.langsearch.index.config;

import org.apache.lucene.analysis.Analyzer;

/**
 * this configuration allows for the definition of a single analyzer to be used for all languages; the
 * indexing is set by default to ANALYZE the content of indexed labels
 * 
 * @author Armando Stellato &lt;stellato@info.uniroma2.it&gt;
 * 
 */
public class StableAnalyzerConfiguration extends IndexingConfigurationAdapter implements
		IndexingConfiguration {

	Analyzer stableAnalyzer;

	public StableAnalyzerConfiguration(Analyzer stableAnalyzer, String... languages) {
		super(languages);
		this.stableAnalyzer = stableAnalyzer;
	}

	public Analyzer getAnalyzerForLabels(String lang) {
		// regarding of the language, always a {@link SStarredGenericTokenAnalyzer} is being returned
		return stableAnalyzer;
	}

	public boolean areLabelsTokenized() {
		return true;
	}

}
